<?php

use yii\db\Migration;

/**
 * Class m190912_055749_auth_group_access
 */
class m190912_055749_auth_group_access extends Migration
{
    /**
     * {@inheritdoc}
     */
    public function safeUp()
    {
        $tableOptions = 'CHARACTER SET utf8 COLLATE utf8_general_ci ENGINE=InnoDB COMMENT="权限组"';
        $this->createTable('{{%auth_group_access}}', [
            'id' => $this->primaryKey(),
            'uid' => $this->integer()->notNull()->comment('用户id'),
            'group_role_id' => $this->integer()->notNull()->comment('权限组id'),
            'created_at' => $this->integer()->notNull(),
            'updated_at' => $this->integer()->notNull(),
            'deleted_at' => $this->integer(),
        ],$tableOptions);

    }

    /**
     * {@inheritdoc}
     */
    public function safeDown()
    {
        $this->dropTable('{{%auth_group_access}}');

        return false;
    }

    /*
    // Use up()/down() to run migration code without a transaction.
    public function up()
    {

    }

    public function down()
    {
        echo "m190912_055749_auth_group_access cannot be reverted.\n";

        return false;
    }
    */
}
